-
-
Notifications
You must be signed in to change notification settings - Fork 969
7.1.x @Scaffold Services and Controllers #15245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.1.x @Scaffold Services and Controllers #15245
Conversation
jdaugherty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is there's no documentation for all of this and there's a whole section of the guide related to scaffolding.
3fbe3e2 to
bb6540a
Compare
sbglasius
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very good (I'm going to use it) and is very well documented.
Thank you @codeconsole
|
Look good @codeconsole. Do we need tests? I find the Aren't the command names and usage instructions inconsistent and confusing (I have not used scaffolding much myself)? Now added to the mix: grails create-scaffold-controller Book
grails create-scaffold-service Book
grails generate-scaffold-all BookDoes From 7.0.3
I think it’s a good idea to start removing the |
|
@matrei Unless we commit to a policy of maintaining source history and restore the previously deleted history, I feel |
|
|
| [source,groovy] | ||
| ---- | ||
| class BookController { | ||
| static scaffold = Book // Legacy syntax - @Scaffold annotation is preferred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could change the AST transform to indicate it's "legacy" so it outputs a warning. Longer term this would allow us to remove the property and keep the api clean.
From when we were in incubation, we learned that one of the major policies of the ASF is to not have authorship of individual files. They even encourage removing @jamesfredley FYI |
|
@jdaugherty @codeconsole Here are a few links with more details on the migration of @author tags to a list in pom.xml https://issues.apache.org/jira/browse/FUNCTOR-17 |
Commands
Generated Files
Domain Classes
testapp/Book.groovy
testapp/Car.groovy
Controllers
testapp/BookController.groovy (basic)
testapp/admin/BookController.groovy (with namespace)
testapp/CarController.groovy (from generate-scaffold-all)
testapp/admin/CarController.groovy (with --service and --namespace)
Services
testapp/BookService.groovy
testapp/CarService.groovy (from generate-scaffold-all)
With --extends Flag
testapp/BookService.groovy (custom superclass)
testapp/BookController.groovy (custom superclass)
Command Options
create-scaffold-controller--force--namespace--servicegrails.plugin.scaffolding.RestfulServiceControllerinstead ofgrails.rest.RestfulController--extendsgrails.rest.RestfulController)create-scaffold-service--force--extendsgrails.plugin.scaffolding.GormService)generate-scaffold-all--force--namespace--serviceExtendsgrails.plugin.scaffolding.GormService)--controllerExtendsgrails.plugin.scaffolding.RestfulServiceController)